﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Core;
using System.Web.UI.HtmlControls;
using System.Data;

namespace Yuanlin.Business
{
    public class TemplateListControl : YuanlinUserControl
    {
        protected Repeater list;

        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack && !AjaxManager.IsCallBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            if (list == null)
            {
                return;
            }

            DataView dv = Templates.Instance().GetData("root");
            list.DataSource = dv;
            list.DataBind();
        }

    }
}